using System;
using System.ComponentModel;

namespace Microsoft.WowAddonStudio.FrameXml.Serialization.Support
{
	/// <summary>
	/// System.EventArgs is the base class for classes containing event data.
	/// </summary>
	public class InheritedPropertyChangingEventArgs : PropertyChangingEventArgs
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="InheritedPropertyChangingEventArgs"/> class.
		/// </summary>
		/// <param name="propertyName">Name of the property.</param>
		/// <param name="value">The value.</param>
		/// <param name="context">The context.</param>
		public InheritedPropertyChangingEventArgs(string propertyName, object value, PropertyBag context) 
			: base(propertyName)
		{
			Value = value;
			Context = context;
		}

		/// <summary>
		/// Gets or sets the value.
		/// </summary>
		/// <value>The value.</value>
		public object Value { get; private set; }

		/// <summary>
		/// Gets or sets the context.
		/// </summary>
		/// <value>The context.</value>
		public PropertyBag Context { get; private set; }

		/// <summary>
		/// Gets or sets a value indicating whether this <see cref="InheritedPropertyChangingEventArgs"/> is cancel.
		/// </summary>
		/// <value><c>true</c> if cancel; otherwise, <c>false</c>.</value>
		public bool Cancel { get; set; }

		/// <summary>
		/// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
		/// </returns>
		public override string ToString()
		{
			return PropertyName;
		}
	}
}